home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
051-075
/
disk_056
/
mcad
/
mp
/
mp.doc
< prev
next >
Wrap
Text File
|
1992-05-06
|
6KB
|
162 lines
**************************************************************************
THIS SOFTWARE IS IN THE PUBLIC DOMAIN. IT IS INTENDED TO
BE AVAILABLE FREE TO WHOMEVER WANTS IT. YOU MAY USE AND
DISTRIBUTE IT AS YOU LIKE WITH THE FOLLOWING RESTRICTIONS:
1) You may not sell this software or charge more than a
small copying/hassle fee for distributing it.
2) Don't remove this notice from the distribution.
Tim Mooney
120 Purefoy Rd.
Chapel Hill, NC 27514
also:
Physics Dept.
Phillips Hall
University of NC
Chapel Hill, NC 27514
****************************************************************************
Mp (short for "Multi-Plot"; the name is stupid, but it's 3 years
old now and I've gotten used to it) plots data embedded in a text file.
You tell mp in which "columns" to expect numbers to plot. Mp reads
the file, looking for lines containing numbers in all of those "columns".
(The first word on a line is, by definition here, in "column" 1.)
When such a line is found, mp begins to store the numbers in arrays. If,
while accumulating an array of data, a line is found which doesn't
contain numbers in all the target "columns", the array is set aside
and mp continues reading, looking for more data. Any number of plots can
be accumulated in this way. Numbers, by the way, may be real, integer, or
mixed; mp doesn't care.
***************************************************************************
CALLING UP THE PROGRAM
Mp is run from the CLI like so:
mp [flags] filename
The flags tell mp where, in the file, to look for numbers it
can plot. Let's say the file to be plotted is called "plotme.dat", and
the lines in this file which contain data look like:
x y err_in_y
. . .
. . .
. . .
Some command line examples for this file:
1) mp plotme.dat
THIS TELLS MP TO USE DEFAULTS FOR THE COLUMN NUMBERS. MP ASSUMES THE
FIRST COLUMN IS X DATA, AND THE SECOND COLUMN IS Y DATA.
2) mp -x1y2 plotme.dat
THIS MEANS EXACTLY THE SAME THING AS (1)
3) mp -x1y2e3 plotme.dat
THE FIRST COLUMN IS X DATA, THE SECOND IS Y DATA, AND THE THIRD IS
ERROR_IN_Y DATA. (MP DOESN'T COLLECT ERROR_IN_Y DATA UNLESS YOU TELL
IT TO.)
4) mp -x0y1 plotme.dat
HERE IS SOMETHING NEW. THIS SAYS THAT X DATA ARE IN COLUMN 0. THERE IS
NO COLUMN 0, HOWEVER. MP UNDERSTANDS THAT THE FILE CONTAINS NO X DATA,
AND USES LINE NUMBERS -- RELATIVE TO THE BEGINNING OF A LIST -- FOR X.
5) mp -e plotme.dat
THIS USES A LOT OF DEFAULTS: X IS ASSUMED TO BE IN COLUMN 1 -- SINCE NO
-X FLAG OCCURS; Y IS ASSUMED TO BE IN THE NEXT COLUMN -- SINCE NO -Y
FLAG OCCURS. THE COMMAND LINE SAYS THAT THE FILE CONTAINS ERROR_IN_Y
DATA, BUT DOESN'T SAY WHERE. THE DEFAULT IS THE COLUMN AFTER THE Y DATA.
WE COULD HAVE GOTTEN THE SAME RESULT WITH "mp -x1y2e3 plotme.dat".
See comments in the file "getdat.c" for a more exact description.
**************************************************************************
SPECIFYING THE DISPLAY OF COLLECTED DATA
When the file has been read, mp tells you how many lists of
numbers it found and asks how to plot the data. You choose which
lists and how the chosen lists are to be plotted. For each list, you
can choose a color or accept a default color. You can choose a line plot,
a point plot, or both for any list. If your choice includes a point plot,
you can choose a point size. (Defaults exist for every choice.)
The line of text you type to tell mp how to plot the data is
called (by me) a "HowTo string". (This is the worst part of the user
interface and is left over from mp's humble beginnings on a VAX.)
The syntax is pretty well described in the source code ("gethowto.c")
and you can get instructions interactively by typing "?". I'm not
going to repeat all the details here, but I will give examples which
can be used with the sample data file "plotme.dat".
1) carriage return
THIS GETS A DEFAULT FOR ALL ACCUMULATED LISTS: LINE PLOTS IN COLORS
BEGINNING WITH 0 AND INCREASING.
2) !p
THIS GETS A POINT PLOT FOR ALL LISTS. THE POINT SIZE IS 4 (DEFAULT).
THE COLORS BEGIN WITH 0 AND INCREASE.
3) 1p 2p 3p 4p
THIS GETS POINT PLOTS FOR THE FIRST FOUR LISTS AND NO PLOT FOR THE REST.
THE COLORS ARE 1 2 3 4. THE POINT SIZE IS 4.
4) p1 p2 p3 p4
THIS GETS POINT PLOTS IN DEFAULT COLORS FOR THE FIRST FOUR LISTS AND
NO PLOT FOR THE REST. THE POINT SIZE IS 1 (MINIMUM) FOR THE FIRST PLOT,
2 FOR THE SECOND...
5) 1l 1l 1l 1l
THIS GETS LINE PLOTS FOR THE FIRST FOUR LISTS AND NO PLOT FOR THE
REST. ALL PLOTS ARE IN COLOR 1.
6) 0p 1p 2p 3p 0l 1l 2l 3l
THIS GETS POINT PLOTS FOR THE FIRST FOUR LISTS AND LINE PLOTS FOR THE
NEXT FOUR. THE POINT SIZE IS 4 SINCE IT IS NOT SPECIFIED. THIS IS MY
PERSONAL FAVORITE FOR THIS FILE SINCE THE FILE COMPRISES FOUR LISTS OF
DATA AND FOUR LISTS OF FITS TO THAT DATA.
7) 0p - - - 1l
THIS GETS A POINT PLOT IN COLOR 0 OF THE FIRST LIST AND A LINE PLOT IN
COLOR 1 OF THE FIFTH LIST. NO OTHER LISTS ARE PLOTTED. THE POINT
SIZE IS 4.
8) - 0p - - - 1l
THIS GETS A POINT PLOT FOR THE SECOND LIST AND A LINE PLOT FOR THE SIXTH.
OTHERWISE, THIS IS THE SAME AS (7)
There are more things you can specify about the plot. I went a
little crazy putting in options and still there are things left out.
This will get you started. See comments in the file "gethowto.c" for
a more exhaustive description.
**************************************************************************
MENUS, ETC.
Once you have a plot on the screen, you can zoom in and out,
call up a crosshair, and generally have a splashing time peering
at your data from close in. You can write the display to a file that
can then be sent to a (HPGL) plotter via something like
"COPY MYFILE.PLT0 SER:"
You can also export the full plot to mCAD, an object-oriented
drawing program. I've used this feature mainly to make transparencies
for an overhead projector (for seminars and such.) The current version
of mp doesn't write labels, legends, or a title to the mCAD file, but,
once in mCAD, you can write or draw whatever you like on the plot.
mCAD, by the way, is a shareware program. This is not a sneaky
way to get you to use mCAD so you'll feel morally obligated to send me
bucks. I just needed to export from mp to mCAD for my own purposes and,
since mp is already in the public domain, didn't see any sense in keeping
the new version to myself.